//
//  WJMeModel.m
//  WJBSApp
//
//  Created by dllo on 16/7/16.
//  Copyright © 2016年 王景伟. All rights reserved.
//

#import "WJMeModel.h"

@implementation WJMeModel


// 编码的方法

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    // 把想要编码的属性依次进行编码
    [aCoder encodeObject:self.image_list forKey:@"image_list"];
//    [aCoder encodeInteger:self.is_sub forKey:@"is_sub"];
    [aCoder encodeInteger:self.sub_number forKey:@"sub_number"];
    [aCoder encodeInteger:self.post_num forKey:@"post_num"];
    [aCoder encodeInteger:self.theme_id forKey:@"theme_id"];
    [aCoder encodeObject:self.theme_name forKey:@"theme_name"];
    
}

// 解码的方法
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        // key 要和上面编码的可以保持一致
        self.image_list = [aDecoder decodeObjectForKey:@"image_list"];
//        self.is_sub = [aDecoder decodeIntegerForKey:@"is_sub"];
        self.sub_number = [aDecoder decodeIntegerForKey:@"sub_number"];
        self.post_num = [aDecoder decodeIntegerForKey:@"post_num"];
        self.theme_id = [aDecoder decodeIntegerForKey:@"theme_id"];
        self.theme_name = [aDecoder decodeObjectForKey:@"theme_name"];
    }
    return self;
}

@end
